package com.ss.android.article.browser.setting;

import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ListView;
import android.widget.TextView;
import com.bytedance.common.utility.UIUtils;
import com.ss.android.article.browser.R;

import java.util.List;

public final class r extends Dialog {
    public interface a {
        void a(List arg1);
    }

    public int a;
    private String b;
    private String[] c;
    private a d;
    private int e;
    private ListView f;
    private TextView g;
    private TextView h;
    private TextView i;
    private View j;
    private View k;

    public r(Context arg8, String arg9, String[] arg10, a arg11) {
        this(arg8, arg9, arg10, arg11, 1, -1);
    }

    public r(Context arg6, String arg7, String[] arg8, a arg9, int arg10, int arg11) {
        super(arg6, R.style.MenuDialogStyle);
        this.a = 0;
        this.b = arg7;
        this.c = arg8;
        this.d = arg9;
        this.e = arg10;
        this.a = arg11;
        View v1 = View.inflate(this.getContext(), R.layout.co, null);
        this.j = v1;
        this.k = v1.findViewById(com.ss.android.article.browser.R.id.rj);
        this.f = v1.findViewById(com.ss.android.article.browser.R.id.rk);
        this.h = v1.findViewById(com.ss.android.article.browser.R.id.rl);
        this.i = v1.findViewById(com.ss.android.article.browser.R.id.rm);
        this.g = v1.findViewById(com.ss.android.article.browser.R.id.hf);
        this.g.setText(this.b);
        int v0 = ((int)(UIUtils.dp2px(this.getContext(), ((float)(this.c.length * 50))) + 1f));
        ViewGroup.LayoutParams v2 = this.f.getLayoutParams();
        v2.height = v0;
        this.f.setLayoutParams(v2);
        v2 = this.k.getLayoutParams();
        v2.height = v0 + v2.height;
        this.k.setLayoutParams(v2);
        this.f.setAdapter(new w(this));
        this.setContentView(v1);
        this.h.setOnClickListener(new s(this));
        this.i.setOnClickListener(new t(this));
        this.j.setOnClickListener(new u(this));
        this.k.setOnClickListener(new v());
        WindowManager.LayoutParams v1_1 = this.getWindow().getAttributes();
        v1_1.width = ((WindowManager)arg6.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth();
        this.getWindow().setAttributes(v1_1);
        this.getWindow().setBackgroundDrawable(new ColorDrawable(0));
    }

    static a a(r arg1) {
        return arg1.d;
    }

    static ListView b(r arg1) {
        return arg1.f;
    }

    static int c(r arg1) {
        return arg1.e;
    }

    static String[] d(r arg1) {
        return arg1.c;
    }

    protected final void onCreate(Bundle arg1) {
        super.onCreate(arg1);
    }

    public final void onWindowFocusChanged(boolean arg5) {
        super.onWindowFocusChanged(arg5);
        if(arg5) {
            this.f.postDelayed(new y(this), 100);
        }
    }

    public final void show() {
        super.show();
    }
}

